Skip to content

Connection close - #6

Merged
w4bremer merged 2 commits into
apigear-io:mainfrom
Eabramov84:connection_close
Jun 1, 2026
Merged

Connection close#6
w4bremer merged 2 commits into
apigear-io:mainfrom
Eabramov84:connection_close

Conversation

@Eabramov84

Copy link
Copy Markdown
Collaborator

📑 Description

Adds a host-agnostic Service Provider Interface (SPI_ that generated JNI bind/unbind code can use to coordinate serviceConnection cleanup with the host application's teardown lifecycle. The need arises when a JNI client binds a Service via a Context whose lifetime is shorter than the binding (e.g. an Android Service Context hosting the engine) -- the host has to drive unbind before that Context is destroyed or Android logs ServiceConnectionLeaked

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Adds a host-agnostic interface that generated JNI bind/unbind code can use to
coordinate ServiceConnection cleanup with the host application's teardown
lifecycle.

* IBindingLifecycleCoordinator: register/unregister Runnable cleanups
* BindingLifecycleRegistry: volatile holder for the host's coordinator;
  generated code is a no-op when no coordinator is installed
@w4bremer
w4bremer merged commit 837cbcd into apigear-io:main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants